<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>学校官网</title>
    <link rel="stylesheet" href="css/style.css">
</head>
<body>
    <header class="tsinghua-header">
        <div class="header-top">
            <div class="container">
                <div class="logo">
                    <img src="images/logo.png" alt="校徽">
                    <span>学校名称</span>
                </div>
                <div class="header-links">
                    <a href="#">English</a>
                    <a href="#">校友</a>
                    <a href="#">教职工</a>
                    <a href="#">学生</a>
                </div>
            </div>
        </div>
        <nav class="main-nav">
            <div class="container">
                <ul>
                    <li><a href="index.html">首页</a></li>
                    <li><a href="about.html">学校概况</a></li>
                    <li><a href="#">人才培养</a></li>
                    <li><a href="#">科学研究</a></li>
                    <li><a href="#">招生就业</a></li>
                    <li><a href="#">国际交流</a></li>
                </ul>
            </div>
        </nav>
    </header>

    <main>
        <section class="banner">
            <div class="slideshow">
                <div class="slide active">
                    <img src="images/banner1.jpg" alt="校园风光">
                    <div class="slide-content">
                        <h1>追求卓越，创造未来</h1>
                        <p>培养具有全球竞争力的高素质人才</p>
                    </div>
                </div>
            </div>
        </section>

        <section class="news-section">
            <div class="container">
                <div class="section-title">
                    <h2>新闻公告</h2>
                    <a href="#" class="more-link">更多 ></a>
                </div>
                <div class="news-list">
                    <article class="news-item">
                        <h3><a href="#">学校举办2025年开学典礼</a></h3>
                        <p class="date">2025-09-01</p>
                        <p>学校隆重举行2025级新生开学典礼，校长发表重要讲话...</p>
                    </article>
                    <article class="news-item">
                        <h3><a href="#">我校科研成果获国家奖励</a></h3>
                        <p class="date">2025-08-25</p>
                        <p>我校XX教授团队研究成果荣获国家自然科学二等奖...</p>
                    </article>
                </div>
            </div>
        </section>

        <section class="quick-links">
            <div class="container">
                <div class="links-grid">
                    <a href="#" class="link-card">
                        <h3>招生信息</h3>
                        <p>了解我校招生政策及专业设置</p>
                    </a>
                    <a href="#" class="link-card">
                        <h3>人才培养</h3>
                        <p>探索创新人才培养模式</p>
                    </a>
                    <a href="#" class="link-card">
                        <h3>国际交流</h3>
                        <p>全球合作与交流项目</p>
                    </a>
                </div>
            </div>
        </section>

        <section class="qa-section">
            <div class="container">
                <h2>智能问答</h2>
                <div class="qa-container">
                    <div id="qa-response"></div>
                    <input type="text" id="qa-question" placeholder="输入您的问题...">
                    <button onclick="askQuestion()">提问</button>
                </div>
            </div>
        </section>
    </main>

    <script>
        function askQuestion() {
            const question = document.getElementById('qa-question').value;
            fetch('/api/ask', {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json'
                },
                body: JSON.stringify({ question })
            })
            .then(response => response.json())
            .then(data => {
                document.getElementById('qa-response').innerHTML = data.answer;
            });
        }
    </script>

    <footer class="tsinghua-footer">
        <div class="container">
            <p>©2025 学校名称 版权所有</p>
        </div>
    </footer>
</body>
</html>